<?php 

/**
* 上传类
*/
class Upload 
{
	public $dirPath='./Uplaod/';
	public $type='jpg,gif,png';
	public $maxSixe='40000';
	public $nameRule='uniqid';
	public $data;
	function __construct($configs=array())
	{
		$this->dirPath = isset($configs['dirPath']) ? $configs['dirPath']:$this->dirPath;
		$this->type = isset($configs['type']) ? $configs['type']:$this->type;
		$this->maxSixe = isset($configs['maxSixe']) ? $configs['maxSixe']:$this->maxSixe;
		$this->nameRule = isset($configs['nameRule']) ? $configs['nameRule']:$this->nameRule;

		$this->data = $this->_reform();

	}

	// 把上传文件存储
	public function save()
	{
		$this->_checkType();
		$this->_checkSize();
		$this->_move();
	}
	//重组数据
	public function _reform()
	{
		
	}
	// 检测类型是否符合要求
	public function _checkType()
	{
		# code...
	}
	//检测文件大小是否符合要求
	public function _checkSize()
	{
		# code...
	}
	//把文件移动 到指定位置
	public function _move()
	{
		# code...
	}
}
















 ?>